package com.qky.controller.userController;


import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.qky.model.user.User;
import com.qky.service.baseService.BaseService;
import com.qky.util.PageUtil;

@Controller
public class ShowUserController {

	@Resource
	BaseService<User> uBaseService;
	
	/**
	 * 展示用户列表
	 * @return "user/show1"
	 */
	@RequestMapping("/showUser1")
	public String showUser1Get(
			ModelMap map) throws Exception {
		PageUtil pageUtil=uBaseService.getUserListByPageUtil(1,10,User.class);
		map.put("pageUtil",1);
		map.put("pageIndex",10);
		map.put("pageUtil",pageUtil);
		return "user/showUser1";
	}
	
	/**
	 * 展示用户列表
	 * @return "user/show1"
	 */
	@RequestMapping("/showUser")
	public String showUserGet(
			ModelMap map) throws Exception {
		PageUtil pageUtil=uBaseService.getUserListByPageUtil(1,10,User.class);
		map.put("pageUtil",1);
		map.put("pageIndex",10);
		map.put("pageUtil",pageUtil);
		return "user/showUser";
	}
	
	/*@RequestMapping(value="/search", method = {RequestMethod.GET})
	@ResponseBody
	public ModelMap search(ModelMap map,HttpServletRequest request,HttpSession session) throws Exception {
		String search="qinkai0";
		User user=userService.getUserByName(search);
		map.addAttribute("user",user);
		System.out.println(map.get("user").toString());
		List<User> list=new ArrayList<User>();
		list.add(user);
		return map;
	}*/
}
